/**
 * 自动生成！请勿修改！
 */
import { command } from '../core/command';

class DistanceSensor {
    constructor(opt = {}) {
        const { device, to, ...opts } = opt;

        this.device = device || {};
        this.opts = opts || {};
        this._to = to;
    }

    get categoryCode() {
        return '010030015';
    }

    get categoryName() {
        return '\u6d4b\u8ddd\u4f20\u611f\u5668';
    }

    getExistObstacle(params) {
        return command({
            method: 'getExistObstacle',
            methodId: 'pgh0mqNU',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    getFrequency(params) {
        return command({
            method: 'getFrequency',
            methodId: 'pGoxHGUm',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    getMeasureDistance(params) {
        return command({
            method: 'getMeasureDistance',
            methodId: 'pDrhFbYw',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    getMeasuredData(params) {
        return command({
            method: 'getMeasuredData',
            methodId: 'phEqKYOC',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    getSwitch(params) {
        return command({
            method: 'getSwitch',
            methodId: 'pZgRT3L5',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    getUnit(params) {
        return command({
            method: 'getUnit',
            methodId: 'p1vFjxgP',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    setFrequency(params) {
        return command({
            method: 'setFrequency',
            methodId: 'ppAXIOWK',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    setSwitch(params) {
        return command({
            method: 'setSwitch',
            methodId: 'peH3nfMM',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    setUnit(params) {
        return command({
            method: 'setUnit',
            methodId: 'pUPQ8Vbl',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }
}

export default DistanceSensor;
